<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>用户修改</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="../../css/ht/ht-UserEdit.css">
</head>
<body style=" background-color: #EEF5F9;">
<?php
//session_start();
//if(!isset($_SESSION["adminname"]))
//    header("location:/final_project/login/login_ht.php?msg=您没有权限，请登录后访问！");
//?>

<?php
$uid = $_GET['uid'];  //接收userList.php页面传来的待修改用户的uid参数
require ('../Common/db.php');
//编写sql语句根据uid取得待修改用户的信息并保存在$row数组中
$sql = "select * from users where uid={$uid}";
$result = mysql_query($sql) or die('查询失败！'.mysql_error());
$row = mysql_fetch_assoc($result);
?>
  <?php require ('../Common/nav.php')?>
<!--  内容部分-->
  <div class="title">
      <span><i>用户修改</i></span>
  </div>
  <div class="content" >
<!--  左边内容starting    -->
   <div class="left">
       <h4 class="img_title" style="text-align: center">原头像:</h4>
    <div class="userImg">
        <img src="../../images/user/<?php echo $row["pic"]; ?>" title="<?php echo $row["uname"]; ?>"
             alt="<?php echo $row["uname"] ?>" style="height: 250px;width: 300px;border-radius: 100%">
    </div>
   </div>
      <!--左边内容ending-->
      <div class="right" >
          <form action="doUserEdit.php" method="post" enctype="multipart/form-data">
              <input type="hidden" name="uid" value="<?php echo $row["uid"];?>">
              <div class="form-group">
                  <label class="col-md-12">用户名修改</label>
                  <div class="col-md-12">
                      <input type="text"   name="uname" required="required" class="form-control form-control-line" placeholder="原用户名：<?php  echo $row["uname"]; ?>">
                  </div>
              </div>
              <div class="form-group">
                  <label class="col-md-12">密码修改</label>
                  <div class="col-md-12">
                      <input type="text"   name="password" required="required" class="form-control form-control-line"placeholder="原密码：<?php  echo $row["password"]; ?>">
                  </div>
              </div>
              <div class="form-group">
                  <label class="col-md-12">性别</label>
                  <div class="col-md-12">
                      <input type="radio" name="gender" value="0" <?php
                      if($row["gender"]==0)
                          echo "checked";
                      ?>>女
                      <input type="radio" name="gender" value="1" <?php
                      if($row["gender"]==1)
                          echo "checked";
                      ?>>男
                  </div>
              </div>
              <div class="form-group">
                  <label class="col-md-12">生日</label>
                  <div class="col-md-12">
                      <input type="date" name="birthdate" class="form-control form-control-line" value="<?php echo $row["birthdate"]; ?>">
                  </div>
              </div>
              <div class="form-group">
                  <label class="col-md-12">学历</label>
                  <div class="col-md-12">
                      <select class="form-control" name="degree">
                          <option  value="4">---请选择---</option>
                          <option  value="0">
                              初中
                          </option>
                          <option  value="1">
                              高中
                          </option>
                          <option  value="2">
                              职校
                          </option>
                          <option  value="3">
                              大专及以上
                          </option>

                      </select>
                  </div>
              </div>
              <div class="form-group">
                  <label for="example-email" class="col-md-12">Email</label>
                  <div class="col-md-12">
                      <input type="email" name="email" required="required" class="form-control form-control-line" placeholder="原邮箱：<?php  echo $row["email"];  ?>">
                  </div>
              </div>
              <div class="form-group">
                  <label class="col-md-12">自我介绍</label>
                  <div class="col-md-12">
                      <textarea name="ntro" style="width: 1100px;height: 90px" placeholder="原自我介绍：<?php  echo $row["ntro"]; ?>"></textarea><br/>
                  </div>
              <div class="form-group">
                  <label class="col-md-12">头像</label>
                  <div class="col-md-12">
                      <label>
                          <input type="file" style="position: absolute;opacity: 0" name="pic" required="required"><br/>
                          <img style="margin-top: -23px" src="../../images/Font_Icon/上传图片.jpg" width="150" height="100" alt="上传图片">
                      </label>
              </div>

              <div class="form-group">
                  <div class="col-sm-12">
                      <button class="btn btn-success" value="更新">更新</button>
                  </div>
              </div>

          </form>
      </div>

  </div>
</body>
</html>